﻿Imports AjaxControlToolkit

Partial Class ucHeader
    Inherits System.Web.UI.UserControl
    Private _index As String
    Public Property index() As String
        Get
            If Me.ViewState.Item("index") = Nothing Then
                Return _index
            Else
                Return CLng(Me.ViewState.Item("index"))
            End If

        End Get
        Set(ByVal Value As String)
            Me.ViewState.Item("index") = Value

        End Set
    End Property
    Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
        Dim sUrl As String
        sUrl = Request.Url.Segments(Request.Url.Segments.Length - 1).ToLower()
        If sUrl.Contains("default.aspx") Then
            hederTitle.InnerHtml = "<h1 style=""margin:0px;font-weight:bold;letter-spacing: 4px;margin-bottom:17px;"">Лечение в Израиле - новости и информация</h1>"
        Else
            hederTitle.Attributes.Add("style", "margin-bottom:17px;")
            hederTitle.InnerHtml = "<strong style=""color:#0b61a4;font-size:36px;margin:0px;font-weight:bold;letter-spacing: 4px;"">Лечение в Израиле - новости и информация</strong>"
        End If



    End Sub
    Protected Sub Page_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreRender
        If index = 1 Then
            hmhr1.Attributes.Add("style", "color:#FFFFFF")
            hmli1.Attributes.Add("style", "background-image:url(images/b1.png); background-repeat: no-repeat; background-position:center;")
        ElseIf index = 2 Then
            hmhr2.Attributes.Add("style", "color:#FFFFFF")
            hmli2.Attributes.Add("style", "background-image:url(images/b1.png); background-repeat: no-repeat; background-position:center;")
        ElseIf index = 3 Then
            hmhr3.Attributes.Add("style", "color:#FFFFFF")
            hmli3.Attributes.Add("style", "background-image:url(images/but2.png); background-repeat: no-repeat; background-position:center;")
        ElseIf index = 4 Then
            hmhr4.Attributes.Add("style", "color:#FFFFFF")
            hmli4.Attributes.Add("style", "background-image:url(images/but2.png); background-repeat: no-repeat; background-position:center;")

        ElseIf index = 5 Then
            hmhr5.Attributes.Add("style", "color:#FFFFFF")
            hmli5.Attributes.Add("style", "background-image:url(images/b6.png); background-repeat: no-repeat; background-position:center;")
        ElseIf index = 6 Then
            hmhr6.Attributes.Add("style", "color:#FFFFFF")
            hmli6.Attributes.Add("style", "background-image:url(images/but2.png); background-repeat: no-repeat; background-position:center;")
        ElseIf index = 7 Then
            hmhr7.Attributes.Add("style", "color:#FFFFFF")
            hmli7.Attributes.Add("style", "background-image:url(images/but4.png); background-repeat: no-repeat; background-position:center;")
        ElseIf index = 8 Then
            hmhr8.Attributes.Add("style", "color:#FFFFFF")
            hmli8.Attributes.Add("style", "background-image:url(images/b3.png); background-repeat: no-repeat; background-position:center;")
        ElseIf index = 9 Then
            hmhr9.Attributes.Add("style", "color:#FFFFFF")
            hmli9.Attributes.Add("style", "background-image:url(images/b5.png); background-repeat: no-repeat; background-position:center;")

        End If

    End Sub

    Protected Sub btnSearch_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles btnSearch.Click
        Response.Redirect("search.aspx?q=" + HttpUtility.UrlEncode(txtSearch.Text))
    End Sub

    Protected Sub btnRss_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles btnRss.Click
        Response.Redirect("rss.aspx")
    End Sub
End Class
